﻿@using PagedList.Mvc;
@model PagedList.IPagedList<OT.Areas.Instructor.Models.AttemptDetailInstructor>
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Instructor/Views/Shared/_Layout.cshtml";
}
<div class="widget">

    <div class="widget-content">
        <div class="padd invoice">
            <div class="row" style="border: 1px solid black">
                <div class="col-md-4">
                    <h4>
                        <strong>Result</strong>
                    </h4>
                    <table>
                        <tr>
                            <td>Passsing Score </td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.PassingScore %</td>
                        </tr>
                        <tr>
                            <td>TotalQuestion </td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.TotalQuestion</td>
                        </tr>
                        <tr>
                            <td>Attempted Questions </td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.AttemptedQuestions</td>
                        </tr>
                        <tr>
                            <td>UnAttempted Questions </td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.UnAttemptedQuestions</td>
                        </tr>
                    </table>
                </div>
                <div class="col-md-4">
                    <h4>
                        <strong>&nbsp;</strong>
                    </h4>
                    <table>
                        <tr>
                            <td>Mark's For Right Answer</td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.totalPositiveMarks</td>
                        </tr>
                        <tr>
                            <td>Mark's for Wrong Answer</td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.totalNegativeMarks</td>
                        </tr>
                        <tr>
                            <td>Total Mark</td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.TotalScore</td>
                        </tr>
                        <tr>
                            <td>Percantage</td>
                            <td>&nbsp;&nbsp;</td>
                            <td>@ViewBag.Percantage % Marks</td>
                        </tr>
                    </table>
                </div>
                <div class="col-md-4">
                    <br />
                    <strong>
                        @if (@ViewBag.Result == "Passed")
                        {
                            
                            <p style="color: green;">Congratulation !! You Have Successfuly Cleared This Exam.</p>
                            <h1 style="color: green;">Result Is @ViewBag.Result</h1>
                        }
                        else
                        {
                            <p style="color: red;">Sorry!! You Have Not Cleared This Exam.</p>
                            <h1 style="color: red;">Result Is @ViewBag.Result</h1>
                        }
                    </strong>

                </div>
            </div>
            <br />
            <hr />
            <div class="row">

                <table class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th class="widget-head">Question</th>
                            <th class="widget-head">Your Answer</th>
                            <th class="widget-head">Correct Answer</th>
                            <th class="widget-head">Is Right</th>
                            <th class="widget-head">Marks</th>
                        </tr>
                    </thead>
                    <tbody style="margin-top: 50px">
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>
                                    @Html.DisplayFor(modelItem => item.QuestionName)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.YourAns)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.CorreAns)
                                </td>
                                <td>
                                    @if (item.IsRight == true)
                                    {
                                        <i class="fa fa-check"></i>
                                    }
                                    else
                                    {
                                        <i class="fa fa-times"></i>
                                    }
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.Marks)
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
    <table>
        <tr>
            <td colspan="5">
                <div class="row-fluid" style="margin-left: 880px; color: #2F96B4; font-size: 13px; font-weight: bold; margin-top: 15px">
                    <b>Total Marks :</b>
                    <span id="TotalMarks"></span>
                    out of
                        <span id="OutOf"></span>
                </div>
            </td>
        </tr>
    </table>

    @section Scripts{
        <script type="text/javascript">
            $(document).ready(function () {
                $('#h2Title').html("<i class='fa fa-arrow-right'></i> Attempt Detail's ");
                $('#aTitle').html('<a href="../AttemptInstructor"> Attempt /</a>' + " Attempt Detail's");
                $('#liAttempt').addClass("open");
                var TotalMarks = '@TempData["TotalMarks"]';
            $("#TotalMarks").html(TotalMarks);
            var OutOf = '@TempData["OutOf"]';
                         $("#OutOf").html(OutOf);
        });
        </script>

    }